import request from '@/utils/http'

// 会员管理接口
export class memberService {
  // 会员配置
  static memberConfig() {
    return request.get({
      url: '/admin/usersset',
      showErrorMessage: false
    })
  }
  // 会员级别-列表
  static memberGradeList(params?: Record<string, any>) {
    return request.get({
      url: '/admin/usersgrade',
      params,
      showErrorMessage: false
    })
  }
  // 会员级别-新增
  static memberGradeCreate(data: Record<string, any>) {
    return request.post({
      url: '/admin/usersgradeadd',
      data,
      showErrorMessage: false
    })
  }
  // 会员级别-查看/修改
  static memberGradeEdit(data: Record<string, any>) {
    return request.post({
      url: '/admin/usersgradeedit',
      data,
      showErrorMessage: false
    })
  }
  // 会员级别-删除
  static memberGradeDelete(data: { id: number } | Record<string, any>) {
    return request.post({
      url: '/admin/usersgradedel',
      data,
      showErrorMessage: false
    })
  }
  // 会员级别-状态
  static memberGradeStatus(data: { id: number; status: number } | Record<string, any>) {
    return request.post({
      url: '/admin/usersgradestatus',
      data,
      showErrorMessage: false
    })
  }
  // 会员列表
  static memberList(params?: Record<string, any>) {
    return request.get({
      url: '/admin/users',
      params,
      showErrorMessage: false
    })
  }
  // 会员列表-查看/修改
  static memberEdit(data: Record<string, any>) {
    return request.post({
      url: '/admin/usersedit',
      data,
      showErrorMessage: false
    })
  }
  // 会员列表-密码
  static memberPassword(data: { id: number; password: string } | Record<string, any>) {
    return request.post({
      url: '/admin/userspass',
      data,
      showErrorMessage: false
    })
  }
  // 会员列表-删除
  static memberDelete(data: { id: number } | Record<string, any>) {
    return request.post({
      url: '/admin/usersdel',
      data,
      showErrorMessage: false
    })
  }
  // 会员列表-状态
  static memberStatus(data: { id: number; status: number } | Record<string, any>) {
    return request.post({
      url: '/admin/usersstatus',
      data,
      showErrorMessage: false
    })
  }
  // 会员信息
  static memberInfo(params: { id: number } | Record<string, any>) {
    return request.get({
      url: '/admin/usersinfo',
      params,
      showErrorMessage: false
    })
  }
  // 会员信息
  static memberInfoEdit(data: Record<string, any>) {
    return request.post({
      url: '/admin/usersinfoedit',
      data,
      showErrorMessage: false
    })
  }
  // 会员信息 删除
  static memberInfoDelete(data: { id: number } | Record<string, any>) {
    return request.post({
      url: '/admin/usersinfodel',
      data,
      showErrorMessage: false
    })
  }
  // 会员信息 状态
  static memberInfoStatus(data: { id: number; status: number } | Record<string, any>) {
    return request.post({
      url: '/admin/usersinfostatus',
      data,
      showErrorMessage: false
    })
  }
  // 会员邀请-列表
  static memberInviteList(data?: Record<string, any>) {
    return request.post({
      url: '/admin/usersinvite',
      data,
      showErrorMessage: false
    })
  }
}
